<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        img{width: 100px;}
    </style>
</head>
<body>
    
</body>
<script>
    // document.write("hello")
    // document.write("<em>123123</em>")

    // var message = "CF";
    // var str = "我的梦想是称为一名" + message + "职业选手";
    // console.log(str);

    // var message = "网络安全";
    // var str = "我的梦想是称为一名'"+message+"'职业选手";
    // var str = '我的梦想是称为一名"'+ message +'"职业选手';
    // console.log(str);

    
    var students = [{
        name:"张三",
        message:"cf",
        img:{
            src:"https://img1.baidu.com/it/u=3515199185,1463278192&fm=26&fmt=auto",
            alt:"2021新年图",
            title:"2021新年图"
        }
    },{
        name:"李四",
        message:"网络安全",
        img:{
            src:"https://img2.baidu.com/it/u=3844839222,4192513329&fm=26&fmt=auto",
            alt:"2021图",
            title:"2021图"
        }
    }]

    // var str = '<img src="'+ students[0].img.src +'" alt="'+ students[0].img.alt +'" title="'+ students[0].img.title +'" />'+ students[0].name +'的梦想是称为一名<b>'+ students[0].message +'</b>职业选手';

    var str = "";
    for(var i=0;i<students.length;i++){
        str += '<img src="'+ students[i].img.src +'" alt="'+ students[i].img.alt +'" title="'+ students[i].img.title +'" />'+ students[i].name +'的梦想是称为一名<b>'+ students[i].message +'</b>职业选手';
    }
    
    document.write(str);


    

</script>
</html>